This invention relates generally to replacing software components in a computer system and more particularly to managing multiple versions of a software component.
Most software applications use software libraries, a group of software routines collected together, usually for a related purpose. The purpose of the library can be said to be the library's "service". Software libraries are made available to a software application through the use of a linker. A linker has the task of combining a series of independently compiled or assembled program routines into a single module (the executable program). Libraries are incorporated into the executable program by one of two linking methods: a library can either be statically linked or dynamically linked to the application. When a library is statically linked, the library or library routine is made part of the executable program during the link. Therefore any modifications to a statically linked library would require a new executable program to be built by the linker.
A dynamically linked library exists, on the other band, outside of the executable program. At link time the linker must know all of the external references of a library, such as the names of the routines available, but does not need to know the actual contents of the library itself, or even its location. It is not until run-time that the program must be able to determine the location of the library. Determining the location of the library at runtime is known as "runtime binding". Therefore a dynamically linked library is free to change everything except its interface definition up until the time it is executed.
However, dynamic linking does not, by itself, provide true dynamic updating. It does not allow for changing a reference to an external procedure during a run after the references have been established. The binding takes place at or before the first time a procedure is invoked. Subsequent references are not typically rebound. Even if the external reference is resolved every time the external procedure is called, dynamic linking is ineffective because it does not allow replacing a software component while that component is being executed. Also, changing libraries by dynamic linking does not keep track of the "state" of the library from the old version to the new version. When the new version is in place, it does not know the state of the library data structures or other state data that the old version had created. This will lead to an update that is unreliable to the user.
To be able to use more than one version of a software library, there must be a way to keep track of which application uses which software library. When a software library is available as a dynamically linked library, an application cannot distinguish between multiple versions of a software library. An application run-time binds to the first version of a software library that it identifies. Therefore, the only way to update to a new version of a dynamically linked library is to make a system-wide switch to the new version of the library, i.e., delete the old version. All applications then upgrade to the new version of the software library. This method involves halting all applications, installing the new version of the library, and restarting the applications, which will now bind to the new version. This method requires all applications on a system to use the same version of the library.
To overcome the problem of an application being unable to determine which version of a software library to runtime bind to, each application can be statically linked directly to its own version of a software library. This removes any ambiguity over which version of the library to use. However, changing a version of the software library used by the application requires the application to be re-linked to the new version of the software library. The application process running with the old version of the software library must be stopped or completed before a new application process with the new version of the software library can be started.
In addition to the inconvenience of halting the application so as to restart using the new version of the library, there are several other disadvantages with this method. Unlike dynamic linking, which involves updating to a new dynamically linked library, static linking to libraries requires linking to the unlinked objects that make up the library. Libraries are often provided by vendors, who generally do not provide the unlinked compiled objects of the library to the end-user for re-linking. Instead vendors usually provide a new dynamic library. Also, in a static link, the location of the library is fixed as of the time of the link. Lastly, this method can be difficult to manage, since it is difficult to tell which version of the library is being used by which application.
Therefore, there is a need for a system and a method for managing the update of a library in a system without requiring the halting of applications using the library.
Further, there is a need to manage such a system to allow for multiple applications to each potentially use its own version of a software library.
Further, there is a need to manage this system in an easy to use and flexible method.